/**
 * Copyright (C), 2019-2020
 * FileName: ArticleController
 * Author:   hnly
 * Date:     2020/6/8 17:09
 * Description:
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package web.controller;

import bean.Article;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import service.IArticleService;

import java.util.List;

@RestController
@RequestMapping("/article")
public class ArticleController {

    @Autowired   //自动注入
    private IArticleService articleService;

    @GetMapping("findAll")
    public List<Article> findAll(){
    return articleService.findAll();
    }


    @GetMapping("findById")
    public String findById(){

        return "这是一个文章";
    }

    @GetMapping("deleteById")
    public String deleteById(){
        return "删除成功";
    }

    @PostMapping("saveOrUpdate")
    public String saveOrUpdate(){
        return "success";
    }
}